<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<!--head部分-->
<head th:include="layout :: htmlhead" th:with="title='后台管理'">
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
    <!--头-->
    <div th:replace="fragments/head :: header"></div>
    <div class="layui-body" style="margin-left: 50px;margin-right: 50px;">
        
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px; width: 80%;">
  <legend>${comment}详细信息</legend>
</fieldset>

    <div class="layui-btn-group">
    	<button class="layui-btn" onclick="backList()">返回列表</button>
    </div>
<div class="layui-form" style="width: 80%;">
  <table class="layui-table">
    <colgroup>
      <col width="150">
      <col width="200">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>参数名</th>
        <th>参数值</th>
      </tr> 
    </thead>
    <tbody id="tbody-result">
    </tbody>
  </table>
</div>
</body>
<script type="text/javascript">
//<![CDATA[
layui.use(['laydate','table'], function(){
  var layer = layui.layer
  ,laydate = layui.laydate
  ,table = layui.table;
  var $ = layui.jquery;
	getUrlParam = function (name) {
	   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	   var r = window.location.search.substr(1).match(reg);
	   if (r != null) return unescape(r[2]); return null;
	  }
	var id = getUrlParam('id');
	if (id != '' && id != null){
	    $.get("detail",{id:id},function(data){
	    	var tbody=window.document.getElementById("tbody-result");
	    	var str = ""
	    	
		    <#list columns as col>
			    <#if !col.primaryKey>
				    <#if col.comment==''>
				      str += "<tr style=\"display:none\">"+
				        "<td>${col.comment}</td>"+
				        "<td>"+data.${col.columnJavaName}+"</td>"+
				      "</tr>";
				    <#else>
				      str += "<tr>"+
				        "<td>${col.comment}</td>"+
				        "<td>"+data.${col.columnJavaName}+"</td>"+
				      "</tr>";
				    </#if>
		        <#else>
			      str += "<tr style=\"display:none\">"+
			        "<td>${col.comment}</td>"+
			        "<td>"+data.${col.columnJavaName}+"</td>"+
			      "</tr>";
			    </#if>
		    </#list>
		    tbody.innerHTML = str;
	    });
	} else {
		layer.msg('获取数据失败');
		backList();
	}
});
function backList(){
	  window.location='listPage.html';
}
// ]]>
</script>
        </div>
        <!--底部-->
        <div th:replace="fragments/footer :: footer"></div>
    </div>
</body>
</html>